<?php
header("Access-Control-Allow-Origin: *");
header('Content-Type:text/html;charset=utf8');
$kuname="longzs";
$table="longzs_re";
include($_SERVER['DOCUMENT_ROOT']."/config.php");
include($_SERVER['DOCUMENT_ROOT']."/myzhuaqu.php");
$host=$_REQUEST["host"];
$_REQUEST["cookie"]=mysqli_real_escape_string($cn,$_REQUEST["cookie"]);
$_REQUEST["token"]=mysqli_real_escape_string($cn,$_REQUEST["token"]);
$sql="UPDATE longzs.longzs_re set cookie='{$_REQUEST["cookie"]}' where `host`='{$host}'";
$id=execute($sql);
execute("update json_host set cookie='{$_REQUEST['cookie']}' where host='{$host}'");
$result=array("id"=>$id,"sql"=>$sql);
echo  json_encode(["id"=>$id,"data" => $result, "code" => 1, "message" => "成功!", "success" => true]);
if($_REQUEST["token"]!=""){
    $sql="UPDATE longzs.longzs_re set token='{$_REQUEST["token"]}' where `host`='{$host}'";
    execute($sql);
}